<?php
namespace app\admin\controller;
use think\Controller;
use app\admin\model\UserModel;
class User extends Admin
{
	//用户列表
    public function index()
    {
    	$userList = (new UserModel())->userList();
    	// dump($userList);die;
    	$this->assign('userList',$userList);
        $this->assign('title','FLY后台管理-用户列表');
        return view('User/index');
    }
    //修改用户信息
    public function edit()
    {
    	$userInfo = (new UserModel())->userfind(input('id'));
    	$this->assign('userInfo',$userInfo);
        $this->assign('title','FLY后台管理-修改用户');
        return view('User/edit');
    }
    //执行修改用户信息操作
    public function editDo()
    {
    	$res = (new UserModel())->userEdit(input('post.'));
    	if($res['valid'])
    		{
    			$this->success($res['msg'],'User/index');
    		}else{
    			$this->error($res['msg']);exit;
    		}
    	

    }

}
